package api

import (
	"github.com/gin-gonic/gin"
	"live-broadcast/api/handler"
)

func LoadRouter(r *gin.Engine) {

	api := r.Group("/api")
	{
		user := api.Group("/user")
		{
			user.POST("register", handler.RegisterUser)
			user.POST("login", handler.LoginUser)
			user.POST("logout", handler.LogoutUser)
		}

		barrage := api.Group("/barrage")
		{
			barrage.POST("add", handler.AddBarrage)
		}

		comment := api.Group("/comment")
		{
			comment.POST("add", handler.AddComment)
		}

		lexicon := api.Group("lexicon")
		{
			lexicon.POST("add", handler.AddLexicon)
			lexicon.POST("delete", handler.DeleteLexicon)
			lexicon.POST("find", handler.FindLexicon)
		}

		illeqal := api.Group("/illeqal")
		{
			illeqal.POST("add", handler.AddIlleqal)
			illeqal.GET("list", handler.ListIlleqal)
			illeqal.GET("num", handler.GetNumBerIlleqal)
		}
	}
}
